package outofmemory;

/**
 * TODO
 *
 * @author zhanghongjiang
 * @version 1.0
 * @date 2021/9/11 22:19
 */
public class StackOverFlow {
    int i = 0 ;

    public static void main(String[] args) {
        StackOverFlow stackOverFlow = new StackOverFlow();
        try{
            stackOverFlow.stack();
        }
        catch (Error error){
            System.out.println(stackOverFlow.i);
            error.printStackTrace();
        }
    }

    public void stack(){
        long a1,a2,a3,a4,a5,a6,a7,a8,a9 = 1;
        long a11,a12,a13,a14,a15,a16,a17,a18,a19 = 1;
        long a21,a22,a23,a24,a25,a26,a27,a28,a29 = 1;
        long a31,a32,a33,a34,a35,a36,a37,a38,a39 = 1;
        long a41,a42,a43,a44,a45,a46,a47,a48,a49 = 1;
        long a51,a52,a53,a54,a55,a56,a57,a58,a59 = 1;
        i++;
        stack();
    }
}
